<?php
/**
 * 奖品信息
 */
namespace App\Contracts\Repositories;

use App\Models\Prize\Prize;

interface PrizeRepository
{
    public function create($prize);

    public function modify($prize, $conditions);

    public function delete($conditions, $softDeletion = true);

    /**
     * @param $id
     *
     * @return Prize
     */
    public function findById($id);

    /**
     * 根据奖品类型获取奖品信息
     * @param $typeId
     * @return mixed
     */
    public function findByType($typeId);

    /**
     * 按条件查询奖品信息，可配置关联模型
     * @param $conditions
     * @param null $withs
     * @param int $limit
     * @param null $offset
     * @return mixed
     */
    public function findByConditions($conditions, $withs = null, $limit = 10, $offset = null);

    /**
     * 按条件获取奖品信息，包括奖品使用信息，活动信息和活动中奖纪录等
     * @param $conditions
     * @param $withs
     * @return mixed
     */
    public function findDetailByConditions($conditions, $withs);

    /**
     * 按条件获取分页信息
     * @param $conditions
     * @param $withs
     * @param $limit
     * @param $offset
     * @return mixed
     */
    public function findPaginateByConditions($conditions, $withs, $limit, $offset);

    public function findAvailableWithPaginate($perPage = 15, $kw = null, $columns = ['*']);
}
